<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1 , user-scalable=no">
    <title>微电影</title>
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/resource/static/base/images/logo.png">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/static/base/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/static/base/css/bootstrap-movie.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/resource/static/base/css/animate.css">
    <!--底部-->
    <style>
        .navbar-brand>img {
            display: inline;
        }

    </style>
    <style>
        .media{
            padding:3px;
            border:1px solid #ccc
        }

    </style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container">
        <!--小屏幕导航按钮和logo-->
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="/film/index" class="navbar-brand" style="width:250px;">
                <img src="${pageContext.request.contextPath}/resource/static/base/images/logo.png" style="height:30px;">&nbsp;微电影
            </a>
        </div>
        <!--小屏幕导航按钮和logo-->
        <!--导航-->
        <div class="navbar-collapse collapse">
            <form class="navbar-form navbar-left" role="search" style="margin-top:18px;">
                <div class="form-group input-group">
                    <input type="text" class="form-control" placeholder="请输入电影名！">
                    <span class="input-group-btn">
                        <a class="btn btn-default"  onclick="doSearch()"><span class="glyphicon glyphicon-search"></span>&nbsp;搜索</a>
                    </span>
                </div>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a class="curlink" href="/film/index"><span class="glyphicon glyphicon-film"></span>&nbsp;电影</a>
                </li>
                <c:if test="${sessionScope.userName =='' or null == sessionScope.userName}">
                    <li>
                        <a class="curlink" href="/person/tologin"><span class="glyphicon glyphicon-log-in"></span>&nbsp;登录</a>
                    </li>
                    <li>
                        <a class="curlink" href="/person/toRegister"><span class="glyphicon glyphicon-plus"></span>&nbsp;注册</a>
                    </li>
                    <li>
                        <a class="curlink" href="/person/tologinUser"><span class="glyphicon glyphicon-user"></span>&nbsp;会员</a>
                    </li>
                </c:if>
                <c:if test="${sessionScope.userName !='' and null != sessionScope.userName}">
                    <li>
                        <a class="curlink" href="/person/toUserInformation"><span class="glyphicon glyphicon-user"></span>&nbsp;${sessionScope.userName}</a>
                    </li>
                    <li>
                        <a class="curlink" href="/person/layout"><span class="glyphicon glyphicon-log-out"></span>&nbsp;退出</a>
                    </li>

                </c:if>
            </ul>
        </div>
        <!--导航-->

    </div>
</nav>
</body>
<script>
    function doSearch(){
        var searchName = $(".form-control").val();
        if(searchName !='' && searchName!=null){
            location.href = "/film/doSearch/"+searchName;
        }
    }
</script>
</html>
